// package com.Stream.A01StreamLiu;
//
// import java.util.ArrayList;
// import java.util.Collections;
// import java.util.List;
// import java.util.stream.Collectors;
// import java.util.stream.Stream;
//
// public class Test02 {
//     public static void main(String[] args) {
//         /*
//         * 现有两个 ArrayList集合 分别存储6名男演员 和女演员
//         * 张三,23
//         *
//         * 男演员只要名字为三个字的前两人
//         * 女演员只要姓杨的 且不要第一个
//         * 把过滤后的男女演员姓名合并到一起
//         * 将上一步的演员组装成一个Actor对象
//         * 将所有演员对象保存到list集合中
//         * */
//         ArrayList<String> man = new ArrayList<>();
//         Collections.addAll(man, "菜坤坤,24","叶齁咸,23","刘不甜,22","吴签,24","谷嘉,30","肖梁梁,27");
//         ArrayList<String> woman = new ArrayList<>();
//         Collections.addAll(woman, "赵小颖,35","杨颖,36","高元元,43","张天天,31","刘诗,35","杨小幂,33");
//         List<String> man2 = man.stream().filter(s -> s.split(",")[0].length() == 3).limit(2).collect(Collectors.toList());
//         List<String> woman2 = woman.stream().filter(s -> s.split(",")[0].startsWith("杨")).skip(1).collect(Collectors.toList());
//         Stream<String> concat = Stream.concat(man2.stream(), woman2.stream());
//         ArrayList<Actor> list = new ArrayList<>();
//         concat.forEach(e ->{
//             String[] split = e.split(",");
//             Actor actor = new Actor(split[0], Integer.parseInt(split[1]));
//             list.add(actor);
//         });
//
//         System.out.println(list);
//
//         List<Actor> collect = Stream.concat(man2.stream(), woman2.stream()).map(e -> {
//             Actor actor = new Actor();
//             String[] split = e.split(",");
//             actor.setName(split[0]);
//             actor.setAge(Integer.parseInt(split[1]));
//             return actor;
//         }).toList();
//         System.out.println(collect);
//     }
// }
